$NG.AllReady(function (
  page,
  {
    useDataIndexChange,
    useValuesChange,
    useUpdateRows,
    useBeforeClick,
    useUpdateRow,
  }
) {
  // 编辑页面逻辑
    const grid = $NG.getCmpApi("grid")
    try {
    //  $NG.getCmpApi('toolbar').hideButton('projAdd')
    const listToolbar = $NG.getCmpApi("toolbar");
    listToolbar.getItem("add").setHidden();

    //隐藏tab页
    $NG
      .getCompMap()
      .get("__Tabs__")[0]
      .getApi()
      .updateItems((innerItems, activeKey) => {
        return [...innerItems.filter((item) => item.key !== "2")];
      });
  } catch (er) {}
  console.log("测试", $NG.getCmpApi("grid"));
  const pertionArr = [
    {
      "roleId": "8570000000000328",
      "roleName": "项目经理",
      "jobName": "项目经理",
      "jobId": "1257"
    },
    {
      "roleId": "8570000000000326",
      "roleName": "销售经理",
      "jobName": "销售经理",
      "jobId": "1267"
    },
    {
      "roleId": "8570000000000335",
      "roleName": "安全员",
      "jobName": "安全员",
      "jobId": "1263"
    },
    {
      "roleId": "8570000000000336",
      "roleName": "仓库管理员",
      "jobName": "仓库管理员",
      "jobId": "1265"
    },
    {
      "roleId": "8570000000000331",
      "roleName": "服务经理",
      "jobName": "服务项目经理",
      "jobId": "8570000000001309"
    },
    {
      "roleId": "8570000000000337",
      "roleName": "资料员",
      "jobName": "资料员",
      "jobId": "1266"
    },
    {
      "roleId": "8570000000000342",
      "roleName": "翻译",
      "jobName": "",
      "jobId": ""
    },
    {
      "roleId": "8570000000000333",
      "roleName": "项目总工",
      "jobName": "项目总工",
      "jobId": "1262"
    },
    {
      "roleId": "8570000000000314",
      "roleName": "服务工程师",
      "jobName": "服务工程师",
      "jobId": "1260"
    },
    {
      "roleId": "8570000000000339",
      "roleName": "测试工程师（研发）",
      "jobName": "",
      "jobId": ""
    },
    {
      "roleId": "8570000000000334",
      "roleName": "质量员",
      "jobName": "质量员",
      "jobId": "1264"
    },
    {
      "roleId": "8570000000000330",
      "roleName": "软件实施工程师",
      "jobName": "实施工程师",
      "jobId": "1259"
    },
    {
      "roleId": "8570000000000329",
      "roleName": "系统集成工程师",
      "jobName": "",
      "jobId": ""
    },
    {
      "roleId": "8570000000000338",
      "roleName": "开发工程师（研发）",
      "jobName": "",
      "jobId": ""
    },
    {
      "roleId": "8570000000000327",
      "roleName": "售前工程师",
      "jobName": "售前工程师",
      "jobId": "1268"
    },
    {
      "roleId": "8570000000000341",
      "roleName": "信号调优工程师",
      "jobName": "信号调优工程师",
      "jobId": "1261"
    },
    {
      "roleId": "8570000000000340",
      "roleName": "规划工程师（研发）",
      "jobName": "",
      "jobId": ""
    },
    {
      "roleId": "8570000000000345",
      "roleName": "国际业务项目经理",
      "jobName": "国际业务部项目经理",
      "jobId": "8570000000001305"
    },
    {
      "roleId": "8570000000000354",
      "roleName": "服务工程师",
      "jobName": "国际业务部服务工程师",
      "jobId": "8570000000001308"
    },
    {
      "roleId": "8570000000000346",
      "roleName": "软件实施工程师",
      "jobName": "国际业务部实施工程师",
      "jobId": "8570000000001307"
    }
  ]
// 项目人员新增
try{
      useUpdateRows(({args})=>{
    
      },'grid')
      useDataIndexChange(({args})=>{
        console.log(`监听成功`,args[0]);
        const item = args[0]
            pertionArr.forEach(el=>{
                if(el.jobId == item.Station){
                    console.log(`找到了`,el,item);
                    item.ActorId = el.roleId,
                    item.ActorId_EXName = el.roleName
                    item.Actorid = el.roleId
                }
                if(el.jobId == item.StationAfter){
                    console.log(`找到了`,el,item);
                    item.ActorIdAfter = el.roleId,
                    item.ActorIdAfter_EXName = el.roleName
                }
            })
        grid.refreshView()
      },"grid.Station")
}catch(err){}
// 项目人员调离
try{
    const joinNewGrid = $NG.getCmpApi("joinNewGrid")
    useDataIndexChange(({args})=>{
        console.log(`调离监听成功`,args);
        const item = args[0]
        pertionArr.forEach(el=>{
            if(el.jobId == item.Station){
                console.log(`找到了`,el,item);
                item.ActorId = el.roleId,
                item.ActorId_EXName = el.roleName
            }
        })
        joinNewGrid.refreshView()
    },"joinNewGrid.Station")
}catch(err){
    console.log(`调离发生`,err);
}
// 人员调动
try{
    useDataIndexChange(({args})=>{
        console.log(`监听成功`,args[0]);
        const item = args[0]
            pertionArr.forEach(el=>{
                if(el.jobId == item.StationAfter){
                    console.log(`找到了`,el,item);
                    item.ActorIdAfter = el.roleId,
                    item.ActorIdAfter_EXName = el.roleName
                }
            })
        grid.refreshView()
      },"grid.StationAfter")
}catch(err){}
});
